package com.example.zlw.dem28;

/**
 * @program: Zlw
 * @description:
 * @author: 诸葛龙辰
 * @create: 2022-11-10 20:44
 **/
@SuppressWarnings("all")
public class Tuxing extends Rectangle{
    private int x;
    public  int y;

    public Tuxing(int x) {
        this.x = x;
    }

    public Tuxing() {
    }

    public Tuxing(int x, int y) {
        this.x = x;
        this.y = y;
    }

    public int getX() {
        return x;
    }

    public void setX(int x) {
        this.x = x;
    }

    public int getY() {
        return y;
    }

    public void setY(int y) {
        this.y = y;
    }
    @Override
    public void length(){
        System.out.println("长："+x+",宽："+y);
    }
    @Override
    public void zhouchang(){
        int pig=2*(x+y);
        System.out.println("野猪佩奇的周长"+pig);
    }
    @Override
    public void area(){
        int heizhu =x*y;
        System.out.println("黑猪佩奇的面积"+heizhu);
    }
}
